using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using ProtoBuf;

namespace Paradogs2
{
    [ProtoContract]
    public class ByteMessage
    {
        [ProtoMember(1)]
        public MessageHeader header;
        [ProtoMember(2)]
        public byte[] dataBytes;

        // 重写 ToString 方法
        public override string ToString()
        {
            return $"Header: {JsonConvert.SerializeObject(header)}, DataBytes: {string.Join(", ", dataBytes)}";
        }
    }

    [ProtoContract]
    public class MessageHeader {
        [ProtoMember(1)]
        public long id; // 回调时作为回复的 ID 使用
        [ProtoMember(2)]
        public string server; // 目标服务器标志
        [ProtoMember(3)]
        public string route; // 目标路由
        [ProtoMember(4)]
        public long replyId; // 回复的消息 ID
        [ProtoMember(5)]
        public string channelId;
        [ProtoMember(6)]
        public long uid;
    }

}